export default {
  state: {
    isTrial: false,
    menuList: [],
    cickFlag: false,
    provinceCityList: [], // 省市县
    isLogin: false, // 是否已登录
    userInfo: {
      UserId: "", // 用户ID
      CompanyId: "", // 企业ID
      Serial: "", // 企业号
      realname: "", // 真实姓名
      username: "", //用户名
      roleid: "", // 角色ID
      isadmin: "", // 是否超级管理员
      departmentid: "", // 部门id
      PSIID: "",
      appKey: "",
      appSecret: "",
      credentialId: "",
      profile: "", // 头像
      position: "", //职位
      subid: "", //企业分公司id
      subName: "", //企业分公司名称
      isApprove: "", //是否开通审批云
      isPurchase: "", //是否开通进销存
    },
    userList: "",
    msgNum: {},
    moduleId: "", // 当前页面id 用于获取按钮权限
    uif: "", // 企业版token
    PermissionTree: [], //模板权限树
    RoleAuthority: [], //导航权限

    islBack: true, // 导航样式 默认典雅黑
    pwd: "", // 登录密码
    companySection: [], // 公司部门树
    thirdPartyUrl: "", // 如果是第三方登录，点击退出按钮，退回到来时的地址
    isEyesHIeld: false,
    expireData: {
      banner: false, //顶部横幅
      window: false, //弹窗
      endDate: "",
      expire: false,
    }, //主页到期的两个弹窗的显示状态
  },
  actions: {
    GetcickFlag() {},
    GetMenuList({ commit }, jurisdictionData) {
      commit("SET_MENU", jurisdictionData);
    },
    GetUserInfo({ commit }, userInfo) {
      commit("SET_USERINFO", userInfo);
    },
    GetMsgNum({ commit }, msgNum) {
      commit("SET_MSGNUM", msgNum);
    },
    GetActionId({ commit }, moduleId) {
      commit("SET_ACTIONID", moduleId);
    },
    GetToken({ commit }, uif) {
      commit("PRE_SAVE", uif);
    },
    getAddressList({ commit }, provinceCityList) {
      commit("SET_ADDRESS", provinceCityList);
    },
    getPermissionTree({ commit }, PermissionTree) {
      commit("SET_PERMISSION", PermissionTree);
    },
    setRoleAuthority({ commit }, RoleAuthority) {
      commit("SET_RoleAuthority", RoleAuthority);
    },
    getUserList({ commit }, userList) {
      commit("SET_USERLIST", userList);
    },
    getIsLogin({ commit }, isLogin) {
      commit("SET_LOGIN", isLogin);
    },
    getIslBack({ commit }, islBack) {
      commit("SET_IS_IBACK", islBack);
    },
    setPWD({ commit }, pwd) {
      commit("SET_PWD", pwd);
    },
    setCompanySection({ commit }, companySection) {
      commit("SET_companySection", companySection);
    },
    setIsEyesHIeld({ commit }, isEyesHIeld) {
      commit("SET_ISEYESHIELD", isEyesHIeld);
    },
    setExpireData({ commit }, expireData) {
      commit("SET_EXPIREDATA", expireData);
    },
  },
  mutations: {
    SET_CLFLAG: (state, action) => {
      state.cickFlag = action;
    },
    SET_ISTRIAL: (state, action) => {
      state.isTrial = action;
    },
    // 菜单列表数据
    SET_MENU: (state, action) => {
      state.menuList = action;
    },
    // 存储用户数据
    SET_USERINFO: (state, action) => {
      state.userInfo = action;
    },
    // 改变当前消息数量
    SET_MSGNUM: (state, action) => {
      state.msgNum = action;
    },
    // 获取页面ActionId
    SET_ACTIONID: (state, action) => {
      state.moduleId = action;
    },
    // 获取uif请求头
    PRE_SAVE: (state, action) => {
      state.uif = action;
    },
    // // 是否修改手机号
    // CELL_PHONE: (state, action) => {
    //   state.cellPhone = action
    // },
    // 存储 省市县
    SET_ADDRESS: (state, action) => {
      state.provinceCityList = action;
    },
    // 存储 模板权限树
    SET_PERMISSION: (state, action) => {
      state.PermissionTree = action;
    },
    SET_RoleAuthority: (state, action) => {
      state.RoleAuthority = action;
    },
    SET_USERLIST: (state, action) => {
      state.userList = action;
    },
    SET_LOGIN: (state, action) => {
      state.isLogin = action;
    },

    SET_IS_IBACK: (state, action) => {
      state.islBack = action;
    },
    SET_PWD: (state, action) => {
      state.pwd = action;
    },
    SET_companySection: (state, action) => {
      state.companySection = action;
    },
    SET_ThirdPartyUrl: (state, action) => {
      state.thirdPartyUrl = action;
    },
    SET_ISEYESHIELD: (state, action) => {
      state.isEyesHIeld = action;
    },
    SET_EXPIREDATA: (state, action) => {
      state.expireData = action;
    },
  },
};
